<template>
	<view class="page">
		<view class="body">
			<view class="title">
				{{holiday.title}}
			</view>
			<u-text :text="holiday.createtime" size="24rpx" color="#BABABA" align="center" margin="10rpx auto" />

		</view>
		<view class="line"></view>
		<u-parse :content="holiday.msg" style="text-align: left;"/>
	</view>
</template>

<script>
	import {
		detail,
		messageRead
	} from "@/request/myApi.js";
	export default {
		data() {
			return {
				holiday: {},
			};
		},
		onLoad(e) {
			this.getData(e.id);
			this.read(e.id);
		},
		methods: {
			// 获取详情
			getData(id) {
				detail({
					id
				}).then((res) => {
					if (res.code == 200) {
						this.holiday = res.data;
					}else{
						uni.showToast({
							title: res.msg,
							duration: 1500,
							icon: 'none',
						})
					}
				});
			},
			// 已读 
			read(id) {
				messageRead({
					id
				}).then((res) => {

				});
			},
		},
	};
</script>

<style lang="less" scoped>
	.page {
		padding: 20rpx;
		text-align: center;

		.title {
			width: 80%;
			font-size: 36rpx;
			font-weight: 500;
			margin: 20rpx auto;
		}

		.body {
			border-bottom: 2rpx solid #D9D9D999;
		}
	}
</style>